﻿using System;
using System.Collections;
using ASPNETVN.PORTAL.Components.UI;

namespace ASPNETVN.PORTAL.Administration.Module
{
    public partial class CustomSetting : AddEditItemControl
    {
        protected override void OnInit(EventArgs e)
        {
            this.Update += CustomSetting_Update;
            ButtonUpdate = this.btnApply;
            ButtonCancel = this.btnCancel;

            base.OnInit(e);
        }

        void CustomSetting_Update(object sender, EventArgs e)
        {
            SettingTable1.UpdateControls(this.ModuleID);

            // Redirect back to the portal home page
            ReturnToReferrerPage();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            SettingTable1.DataSource = new SortedList(this.Settings);
            SettingTable1.DataBind();
        }
    }
}
